<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>基础组件 Chat | JwChat</title>
    <meta name="generator" content="VuePress 1.8.2">
    
    <meta name="description" content="languages is all">
    <meta name="keywords" content="vue,im,IM,聊天组件,vue组件">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="descriptione" content="基于vue开发的仿QQ聊天组件">
    
    <link rel="preload" href="/jwchatdoc/assets/css/0.styles.88dd726d.css" as="style"><link rel="preload" href="/jwchatdoc/assets/js/app.2f005bd9.js" as="script"><link rel="preload" href="/jwchatdoc/assets/js/2.0a6120b0.js" as="script"><link rel="preload" href="/jwchatdoc/assets/js/4.9bd699fc.js" as="script"><link rel="prefetch" href="/jwchatdoc/assets/js/10.69421091.js"><link rel="prefetch" href="/jwchatdoc/assets/js/11.7a399bd7.js"><link rel="prefetch" href="/jwchatdoc/assets/js/12.99033945.js"><link rel="prefetch" href="/jwchatdoc/assets/js/13.279bab3c.js"><link rel="prefetch" href="/jwchatdoc/assets/js/14.2f230c3a.js"><link rel="prefetch" href="/jwchatdoc/assets/js/15.f9aa9fc4.js"><link rel="prefetch" href="/jwchatdoc/assets/js/16.3ba8d5b4.js"><link rel="prefetch" href="/jwchatdoc/assets/js/17.e53d4f10.js"><link rel="prefetch" href="/jwchatdoc/assets/js/18.bce088f4.js"><link rel="prefetch" href="/jwchatdoc/assets/js/19.f51d6632.js"><link rel="prefetch" href="/jwchatdoc/assets/js/20.15eb3f0e.js"><link rel="prefetch" href="/jwchatdoc/assets/js/21.a1303875.js"><link rel="prefetch" href="/jwchatdoc/assets/js/3.55e62092.js"><link rel="prefetch" href="/jwchatdoc/assets/js/5.cab4c999.js"><link rel="prefetch" href="/jwchatdoc/assets/js/6.93ce79e4.js"><link rel="prefetch" href="/jwchatdoc/assets/js/7.6a0b259c.js"><link rel="prefetch" href="/jwchatdoc/assets/js/8.4b5ca820.js"><link rel="prefetch" href="/jwchatdoc/assets/js/9.c7a03d0b.js">
    <link rel="stylesheet" href="/jwchatdoc/assets/css/0.styles.88dd726d.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/jwchatdoc/" class="home-link router-link-active"><!----> <span class="site-name">JwChat</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/jwchatdoc/guide/" class="nav-link">
  使用
</a></div><div class="nav-item"><a href="/jwchatdoc/component/" class="nav-link router-link-active">
  组件
</a></div><div class="nav-item"><a href="/jwchatdoc/updateTip/" class="nav-link">
  更新
</a></div><div class="nav-item"><a href="https://gitee.com/CodeGI/chat" target="_blank" rel="noopener noreferrer" class="nav-link external">
  项目地址
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="http://codegi.gitee.io/jwchatdoc/demo/index.html" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Demo
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/jwchatdoc/guide/" class="nav-link">
  使用
</a></div><div class="nav-item"><a href="/jwchatdoc/component/" class="nav-link router-link-active">
  组件
</a></div><div class="nav-item"><a href="/jwchatdoc/updateTip/" class="nav-link">
  更新
</a></div><div class="nav-item"><a href="https://gitee.com/CodeGI/chat" target="_blank" rel="noopener noreferrer" class="nav-link external">
  项目地址
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="http://codegi.gitee.io/jwchatdoc/demo/index.html" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Demo
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav>  <ul class="sidebar-links"><li><a href="/jwchatdoc/component/chat.html" aria-current="page" class="active sidebar-link">基础组件 Chat</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/jwchatdoc/component/chat.html#jwchat" class="sidebar-link">JwChat</a></li><li class="sidebar-sub-header"><a href="/jwchatdoc/component/chat.html#参数配置" class="sidebar-link">参数配置</a></li></ul></li><li><a href="/jwchatdoc/component/chatIndex.html" class="sidebar-link">chat组件界面</a></li><li><a href="/jwchatdoc/component/rightbox.html" class="sidebar-link">右边栏-仿QQ群</a></li><li><a href="/jwchatdoc/component/talk.html" class="sidebar-link">快捷回复组件</a></li><li><a href="/jwchatdoc/component/user.html" class="sidebar-link">用户组件</a></li><li><a href="/jwchatdoc/component/empty.html" class="sidebar-link">empty组件</a></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default" data-v-c7788be4 data-v-c7788be4><h1 id="基础组件-chat" data-v-c7788be4><a href="#基础组件-chat" class="header-anchor" data-v-c7788be4>#</a> 基础组件 Chat</h1> <h2 id="jwchat" data-v-c7788be4><a href="#jwchat" class="header-anchor" data-v-c7788be4>#</a> JwChat</h2> <div class="tip" data-v-c7788be4></div> <JwChat taleList="" scrollType="noroll" toolConfig="[object Object]" placeholder="欢迎使用JwChat..." config="[object Object]" class="jwChat" data-v-c7788be4></JwChat> <details class="custom-block details" data-v-c7788be4><summary data-v-c7788be4>点击查看代码</summary> <div class="language-vue extra-class" data-v-c7788be4><pre class="language-vue" data-v-c7788be4><code data-v-c7788be4><span class="token tag" data-v-c7788be4><span class="token tag" data-v-c7788be4><span class="token punctuation" data-v-c7788be4>&lt;</span>JwChat</span>
  <span class="token attr-name" data-v-c7788be4>ref</span><span class="token attr-value" data-v-c7788be4><span class="token punctuation attr-equals" data-v-c7788be4>=</span><span class="token punctuation" data-v-c7788be4>&quot;</span>jwChat<span class="token punctuation" data-v-c7788be4>&quot;</span></span>
  <span class="token attr-name" data-v-c7788be4>v-model</span><span class="token attr-value" data-v-c7788be4><span class="token punctuation attr-equals" data-v-c7788be4>=</span><span class="token punctuation" data-v-c7788be4>&quot;</span>inputMsg<span class="token punctuation" data-v-c7788be4>&quot;</span></span>
  <span class="token attr-name" data-v-c7788be4>:config</span><span class="token attr-value" data-v-c7788be4><span class="token punctuation attr-equals" data-v-c7788be4>=</span><span class="token punctuation" data-v-c7788be4>&quot;</span>config<span class="token punctuation" data-v-c7788be4>&quot;</span></span>
  <span class="token attr-name" data-v-c7788be4>:taleList</span><span class="token attr-value" data-v-c7788be4><span class="token punctuation attr-equals" data-v-c7788be4>=</span><span class="token punctuation" data-v-c7788be4>&quot;</span>list<span class="token punctuation" data-v-c7788be4>&quot;</span></span>
  <span class="token attr-name" data-v-c7788be4>:scrollType</span><span class="token attr-value" data-v-c7788be4><span class="token punctuation attr-equals" data-v-c7788be4>=</span><span class="token punctuation" data-v-c7788be4>&quot;</span>scrollType<span class="token punctuation" data-v-c7788be4>&quot;</span></span>
  <span class="token attr-name" data-v-c7788be4>:toolConfig</span><span class="token attr-value" data-v-c7788be4><span class="token punctuation attr-equals" data-v-c7788be4>=</span><span class="token punctuation" data-v-c7788be4>&quot;</span>tool<span class="token punctuation" data-v-c7788be4>&quot;</span></span>
  <span class="token attr-name" data-v-c7788be4>:placeholder</span><span class="token attr-value" data-v-c7788be4><span class="token punctuation attr-equals" data-v-c7788be4>=</span><span class="token punctuation" data-v-c7788be4>&quot;</span>placeholder<span class="token punctuation" data-v-c7788be4>&quot;</span></span>
  <span class="token attr-name" data-v-c7788be4>:quickList</span><span class="token attr-value" data-v-c7788be4><span class="token punctuation attr-equals" data-v-c7788be4>=</span><span class="token punctuation" data-v-c7788be4>&quot;</span>quickList<span class="token punctuation" data-v-c7788be4>&quot;</span></span>
  <span class="token attr-name" data-v-c7788be4>@enter</span><span class="token attr-value" data-v-c7788be4><span class="token punctuation attr-equals" data-v-c7788be4>=</span><span class="token punctuation" data-v-c7788be4>&quot;</span>bindEnter<span class="token punctuation" data-v-c7788be4>&quot;</span></span>
  <span class="token attr-name" data-v-c7788be4>@clickTalk</span><span class="token attr-value" data-v-c7788be4><span class="token punctuation attr-equals" data-v-c7788be4>=</span><span class="token punctuation" data-v-c7788be4>&quot;</span>talkEvent<span class="token punctuation" data-v-c7788be4>&quot;</span></span>
<span class="token punctuation" data-v-c7788be4>&gt;</span></span>

  <span class="token comment" data-v-c7788be4>&lt;!-- &lt;template slot=&quot;enter&quot;&gt;
    &lt;div&gt;自定义输入框&lt;/div&gt;
  &lt;/template&gt; --&gt;</span>
  <span class="token comment" data-v-c7788be4>&lt;!-- &lt;template slot=&quot;enterBtn&quot;&gt;
    &lt;div&gt;自定义按钮&lt;/div&gt;
  &lt;/template&gt; --&gt;</span>
  <span class="token comment" data-v-c7788be4>&lt;!-- &lt;template #downBtn=&quot;{unread}&quot;&gt;
    &lt;div&gt;
      未读{{unread}}
    &lt;/div&gt;
  &lt;/template&gt; --&gt;</span>
  <span class="token comment" data-v-c7788be4>&lt;!-- &lt;template #talkItem=&quot;{ data }&quot;&gt;
        自定义对话框{{ data }}
      &lt;/template&gt; --&gt;</span>
  <span class="token comment" data-v-c7788be4>&lt;!-- &lt;template slot=&quot;tools&quot;&gt;
    &lt;div style=&quot;width: 20rem; text-align: right&quot; @click=&quot;toolEvent(12)&quot;&gt;
      &lt;JwChat-icon type=&quot;icon-lishi&quot; title=&quot;自定义&quot; /&gt;
    &lt;/div&gt;
  &lt;/template&gt; --&gt;</span>
<span class="token tag" data-v-c7788be4><span class="token tag" data-v-c7788be4><span class="token punctuation" data-v-c7788be4>&lt;/</span>JwChat</span><span class="token punctuation" data-v-c7788be4>&gt;</span></span>

<span class="token tag" data-v-c7788be4><span class="token tag" data-v-c7788be4><span class="token punctuation" data-v-c7788be4>&lt;</span>script</span><span class="token punctuation" data-v-c7788be4>&gt;</span></span><span class="token script" data-v-c7788be4><span class="token language-javascript" data-v-c7788be4>
<span class="token keyword" data-v-c7788be4>export</span> <span class="token keyword" data-v-c7788be4>default</span> <span class="token punctuation" data-v-c7788be4>{</span>
  <span class="token function" data-v-c7788be4>data</span> <span class="token punctuation" data-v-c7788be4>(</span><span class="token punctuation" data-v-c7788be4>)</span> <span class="token punctuation" data-v-c7788be4>{</span>
    <span class="token keyword" data-v-c7788be4>return</span> <span class="token punctuation" data-v-c7788be4>{</span>
      scrollType<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'noroll'</span><span class="token punctuation" data-v-c7788be4>,</span> <span class="token comment" data-v-c7788be4>// scroll  noroll 俩种类型</span>
      placeholder<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;欢迎使用JwChat...&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
      inputMsg<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>''</span><span class="token punctuation" data-v-c7788be4>,</span>
      taleList<span class="token operator" data-v-c7788be4>:</span> <span class="token punctuation" data-v-c7788be4>[</span><span class="token punctuation" data-v-c7788be4>]</span><span class="token punctuation" data-v-c7788be4>,</span>
      tool<span class="token operator" data-v-c7788be4>:</span> <span class="token punctuation" data-v-c7788be4>{</span>
        callback<span class="token operator" data-v-c7788be4>:</span> <span class="token keyword" data-v-c7788be4>this</span><span class="token punctuation" data-v-c7788be4>.</span>toolEvent
      <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
      quickList<span class="token operator" data-v-c7788be4>:</span> <span class="token punctuation" data-v-c7788be4>[</span>
        <span class="token punctuation" data-v-c7788be4>{</span>text<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'这里是jwchat，您想了解什么问题。'</span><span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
        <span class="token punctuation" data-v-c7788be4>{</span>text<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'jwchat是最好的聊天组件'</span><span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
        <span class="token punctuation" data-v-c7788be4>{</span>text<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'谁将烟焚散，散了纵横的牵绊；听弦断，断那三千痴缠。'</span><span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
        <span class="token punctuation" data-v-c7788be4>{</span>text<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'长夏逝去。山野间的初秋悄然涉足。'</span><span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
        <span class="token punctuation" data-v-c7788be4>{</span>text<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'江南风骨，天水成碧，天教心愿与身违。'</span><span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
        <span class="token punctuation" data-v-c7788be4>{</span>text<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'总在不经意的年生。回首彼岸。纵然发现光景绵长。'</span><span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
        <span class="token punctuation" data-v-c7788be4>{</span>text<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'外面的烟花奋力的燃着，屋里的人激情的说着情话'</span><span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
        <span class="token punctuation" data-v-c7788be4>{</span>text<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'假如你是云，我就是雨，一生相伴，风风雨雨；'</span><span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
        <span class="token punctuation" data-v-c7788be4>{</span>text<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'即使泪水在眼中打转，我依旧可以笑的很美，这是你学不来的坚强。'</span><span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
        <span class="token punctuation" data-v-c7788be4>{</span>text<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>' 因为不知来生来世会不会遇到你，所以今生今世我会加倍爱你。'</span><span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
      <span class="token punctuation" data-v-c7788be4>]</span><span class="token punctuation" data-v-c7788be4>,</span>
      config<span class="token operator" data-v-c7788be4>:</span> <span class="token punctuation" data-v-c7788be4>{</span>
        historyConfig<span class="token operator" data-v-c7788be4>:</span> <span class="token punctuation" data-v-c7788be4>{</span>
          show<span class="token operator" data-v-c7788be4>:</span> <span class="token boolean" data-v-c7788be4>false</span><span class="token punctuation" data-v-c7788be4>,</span>
          tip<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;加载更多提示框,可以直接使用组件的&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
          callback<span class="token operator" data-v-c7788be4>:</span> <span class="token keyword" data-v-c7788be4>this</span><span class="token punctuation" data-v-c7788be4>.</span>bindLoadHistory<span class="token punctuation" data-v-c7788be4>,</span>
        <span class="token punctuation" data-v-c7788be4>}</span>
      <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
    <span class="token punctuation" data-v-c7788be4>}</span>
  <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
  methods<span class="token operator" data-v-c7788be4>:</span> <span class="token punctuation" data-v-c7788be4>{</span>
    <span class="token comment" data-v-c7788be4>/**
     * @description: 点击加载更多的回调函数
     * @param {*}
     * @return {*}
     */</span>
    <span class="token keyword" data-v-c7788be4>async</span> <span class="token function" data-v-c7788be4>bindLoadHistory</span><span class="token punctuation" data-v-c7788be4>(</span><span class="token punctuation" data-v-c7788be4>)</span> <span class="token punctuation" data-v-c7788be4>{</span>
      <span class="token keyword" data-v-c7788be4>const</span> history <span class="token operator" data-v-c7788be4>=</span> <span class="token keyword" data-v-c7788be4>new</span> <span class="token class-name" data-v-c7788be4>Array</span><span class="token punctuation" data-v-c7788be4>(</span><span class="token number" data-v-c7788be4>3</span><span class="token punctuation" data-v-c7788be4>)</span><span class="token punctuation" data-v-c7788be4>.</span><span class="token function" data-v-c7788be4>fill</span><span class="token punctuation" data-v-c7788be4>(</span><span class="token punctuation" data-v-c7788be4>)</span><span class="token punctuation" data-v-c7788be4>.</span><span class="token function" data-v-c7788be4>map</span><span class="token punctuation" data-v-c7788be4>(</span><span class="token punctuation" data-v-c7788be4>(</span><span class="token parameter" data-v-c7788be4>i<span class="token punctuation" data-v-c7788be4>,</span> j</span><span class="token punctuation" data-v-c7788be4>)</span> <span class="token operator" data-v-c7788be4>=&gt;</span> <span class="token punctuation" data-v-c7788be4>{</span>
        <span class="token keyword" data-v-c7788be4>return</span> <span class="token punctuation" data-v-c7788be4>{</span>
          date<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;2020/05/20 23:19:07&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
          text<span class="token operator" data-v-c7788be4>:</span> <span class="token punctuation" data-v-c7788be4>{</span> text<span class="token operator" data-v-c7788be4>:</span> j <span class="token operator" data-v-c7788be4>+</span> <span class="token keyword" data-v-c7788be4>new</span> <span class="token class-name" data-v-c7788be4>Date</span><span class="token punctuation" data-v-c7788be4>(</span><span class="token punctuation" data-v-c7788be4>)</span> <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
          mine<span class="token operator" data-v-c7788be4>:</span> <span class="token boolean" data-v-c7788be4>false</span><span class="token punctuation" data-v-c7788be4>,</span>
          name<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;JwChat&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
          img<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;image/three.jpeg&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
        <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>;</span>
      <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>)</span><span class="token punctuation" data-v-c7788be4>;</span>
      <span class="token keyword" data-v-c7788be4>let</span> list <span class="token operator" data-v-c7788be4>=</span> history<span class="token punctuation" data-v-c7788be4>.</span><span class="token function" data-v-c7788be4>concat</span><span class="token punctuation" data-v-c7788be4>(</span><span class="token keyword" data-v-c7788be4>this</span><span class="token punctuation" data-v-c7788be4>.</span>taleList<span class="token punctuation" data-v-c7788be4>)</span><span class="token punctuation" data-v-c7788be4>;</span>
      <span class="token keyword" data-v-c7788be4>this</span><span class="token punctuation" data-v-c7788be4>.</span>taleList <span class="token operator" data-v-c7788be4>=</span> list<span class="token punctuation" data-v-c7788be4>;</span>
      console<span class="token punctuation" data-v-c7788be4>.</span><span class="token function" data-v-c7788be4>log</span><span class="token punctuation" data-v-c7788be4>(</span><span class="token string" data-v-c7788be4>&quot;加载历史&quot;</span><span class="token punctuation" data-v-c7788be4>,</span> list<span class="token punctuation" data-v-c7788be4>,</span> history<span class="token punctuation" data-v-c7788be4>)</span><span class="token punctuation" data-v-c7788be4>;</span>
      <span class="token comment" data-v-c7788be4>//  加载完成后通知组件关闭加载动画</span>
      <span class="token keyword" data-v-c7788be4>this</span><span class="token punctuation" data-v-c7788be4>.</span>config<span class="token punctuation" data-v-c7788be4>.</span>historyConfig<span class="token punctuation" data-v-c7788be4>.</span>tip <span class="token operator" data-v-c7788be4>=</span> <span class="token string" data-v-c7788be4>&quot;加载完成&quot;</span><span class="token punctuation" data-v-c7788be4>;</span>
      <span class="token keyword" data-v-c7788be4>this</span><span class="token punctuation" data-v-c7788be4>.</span><span class="token function" data-v-c7788be4>$nextTick</span><span class="token punctuation" data-v-c7788be4>(</span><span class="token punctuation" data-v-c7788be4>(</span><span class="token punctuation" data-v-c7788be4>)</span> <span class="token operator" data-v-c7788be4>=&gt;</span> <span class="token punctuation" data-v-c7788be4>{</span>
        <span class="token keyword" data-v-c7788be4>this</span><span class="token punctuation" data-v-c7788be4>.</span>$refs<span class="token punctuation" data-v-c7788be4>.</span>jwChat<span class="token punctuation" data-v-c7788be4>.</span><span class="token function" data-v-c7788be4>finishPullDown</span><span class="token punctuation" data-v-c7788be4>(</span><span class="token punctuation" data-v-c7788be4>)</span><span class="token punctuation" data-v-c7788be4>;</span>
      <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>)</span><span class="token punctuation" data-v-c7788be4>;</span>
    <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
    <span class="token function" data-v-c7788be4>bindEnter</span> <span class="token punctuation" data-v-c7788be4>(</span><span class="token parameter" data-v-c7788be4>e</span><span class="token punctuation" data-v-c7788be4>)</span> <span class="token punctuation" data-v-c7788be4>{</span>
      console<span class="token punctuation" data-v-c7788be4>.</span><span class="token function" data-v-c7788be4>log</span><span class="token punctuation" data-v-c7788be4>(</span>e<span class="token punctuation" data-v-c7788be4>)</span>
      <span class="token keyword" data-v-c7788be4>const</span> msg <span class="token operator" data-v-c7788be4>=</span> <span class="token keyword" data-v-c7788be4>this</span><span class="token punctuation" data-v-c7788be4>.</span>inputMsg
      <span class="token keyword" data-v-c7788be4>if</span> <span class="token punctuation" data-v-c7788be4>(</span><span class="token operator" data-v-c7788be4>!</span>msg<span class="token punctuation" data-v-c7788be4>)</span> <span class="token keyword" data-v-c7788be4>return</span><span class="token punctuation" data-v-c7788be4>;</span>
      <span class="token keyword" data-v-c7788be4>const</span> msgObj <span class="token operator" data-v-c7788be4>=</span> <span class="token punctuation" data-v-c7788be4>{</span>
        <span class="token string" data-v-c7788be4>&quot;date&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;2020/05/20 23:19:07&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
        <span class="token string" data-v-c7788be4>&quot;text&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token punctuation" data-v-c7788be4>{</span> <span class="token string" data-v-c7788be4>&quot;text&quot;</span><span class="token operator" data-v-c7788be4>:</span> msg <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
        <span class="token string" data-v-c7788be4>&quot;mine&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token boolean" data-v-c7788be4>true</span><span class="token punctuation" data-v-c7788be4>,</span>
        <span class="token string" data-v-c7788be4>&quot;name&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;JwChat&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
        <span class="token string" data-v-c7788be4>&quot;img&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;../image/three.jpeg&quot;</span>
      <span class="token punctuation" data-v-c7788be4>}</span>
      <span class="token keyword" data-v-c7788be4>this</span><span class="token punctuation" data-v-c7788be4>.</span>list<span class="token punctuation" data-v-c7788be4>.</span><span class="token function" data-v-c7788be4>push</span><span class="token punctuation" data-v-c7788be4>(</span>msgObj<span class="token punctuation" data-v-c7788be4>)</span>
    <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
    <span class="token function" data-v-c7788be4>toolEvent</span> <span class="token punctuation" data-v-c7788be4>(</span><span class="token parameter" data-v-c7788be4>type<span class="token punctuation" data-v-c7788be4>,</span> obj</span><span class="token punctuation" data-v-c7788be4>)</span> <span class="token punctuation" data-v-c7788be4>{</span>
      console<span class="token punctuation" data-v-c7788be4>.</span><span class="token function" data-v-c7788be4>log</span><span class="token punctuation" data-v-c7788be4>(</span><span class="token string" data-v-c7788be4>'tools'</span><span class="token punctuation" data-v-c7788be4>,</span> type<span class="token punctuation" data-v-c7788be4>,</span> obj<span class="token punctuation" data-v-c7788be4>)</span>
    <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
    <span class="token function" data-v-c7788be4>talkEvent</span> <span class="token punctuation" data-v-c7788be4>(</span><span class="token parameter" data-v-c7788be4>play</span><span class="token punctuation" data-v-c7788be4>)</span> <span class="token punctuation" data-v-c7788be4>{</span>
      console<span class="token punctuation" data-v-c7788be4>.</span><span class="token function" data-v-c7788be4>log</span><span class="token punctuation" data-v-c7788be4>(</span>play<span class="token punctuation" data-v-c7788be4>)</span>
    <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
  <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
   <span class="token function" data-v-c7788be4>mounted</span> <span class="token punctuation" data-v-c7788be4>(</span><span class="token punctuation" data-v-c7788be4>)</span> <span class="token punctuation" data-v-c7788be4>{</span>
    <span class="token keyword" data-v-c7788be4>const</span> img <span class="token operator" data-v-c7788be4>=</span> <span class="token string" data-v-c7788be4>'https://www.baidu.com/img/flexible/logo/pc/result.png'</span>
    <span class="token keyword" data-v-c7788be4>const</span> list <span class="token operator" data-v-c7788be4>=</span> <span class="token punctuation" data-v-c7788be4>[</span>
        <span class="token punctuation" data-v-c7788be4>{</span>
          <span class="token string" data-v-c7788be4>&quot;date&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;2020/04/25 21:19:07&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;text&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token punctuation" data-v-c7788be4>{</span> <span class="token string" data-v-c7788be4>&quot;text&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;起床不&quot;</span> <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;mine&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token boolean" data-v-c7788be4>false</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;name&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;留恋人间不羡仙&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;img&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;../image/one.jpeg&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token comment" data-v-c7788be4>// &quot;custom&quot;: true, // 自定义对话框开关</span>
        <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
        <span class="token punctuation" data-v-c7788be4>{</span>
          <span class="token string" data-v-c7788be4>&quot;date&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;2020/04/25 21:19:07&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;text&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token punctuation" data-v-c7788be4>{</span> <span class="token string" data-v-c7788be4>&quot;text&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;&lt;audio data-src='https://www.w3school.com.cn/i/horse.mp3'/&gt;&quot;</span> <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;mine&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token boolean" data-v-c7788be4>false</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;name&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;只盼流星不盼雨&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;img&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;../image/two.jpeg&quot;</span>
        <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
        <span class="token punctuation" data-v-c7788be4>{</span>
          <span class="token string" data-v-c7788be4>&quot;date&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;2020/04/25 21:19:07&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;text&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token punctuation" data-v-c7788be4>{</span> <span class="token string" data-v-c7788be4>&quot;text&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;&lt;img data-src='&quot;</span><span class="token operator" data-v-c7788be4>+</span>img<span class="token operator" data-v-c7788be4>+</span><span class="token string" data-v-c7788be4>&quot;'/&gt;&quot;</span> <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;mine&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token boolean" data-v-c7788be4>false</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;name&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;只盼流星不盼雨&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;img&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;../image/two.jpeg&quot;</span>
        <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
        <span class="token punctuation" data-v-c7788be4>{</span>
          <span class="token string" data-v-c7788be4>&quot;date&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;2020/04/25 21:19:07&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;text&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token punctuation" data-v-c7788be4>{</span> <span class="token string" data-v-c7788be4>&quot;text&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;&lt;img data-src='../image/three.jpeg'/&gt;&quot;</span> <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;mine&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token boolean" data-v-c7788be4>false</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;name&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;只盼流星不盼雨&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;img&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;../image/two.jpeg&quot;</span>
        <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
        <span class="token punctuation" data-v-c7788be4>{</span>
          <span class="token string" data-v-c7788be4>&quot;date&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;2020/04/16 21:19:07&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;text&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token punctuation" data-v-c7788be4>{</span> <span class="token string" data-v-c7788be4>&quot;text&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;&lt;video data-src='https://www.w3school.com.cn/i/movie.mp4' controls='controls' /&gt;&quot;</span> <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;mine&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token boolean" data-v-c7788be4>true</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;name&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;JwChat&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;img&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;../image/three.jpeg&quot;</span>
        <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
        <span class="token punctuation" data-v-c7788be4>{</span>
          <span class="token string" data-v-c7788be4>&quot;date&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;2021/03/02 13:14:21&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;mine&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token boolean" data-v-c7788be4>false</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;name&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;留恋人间不羡仙&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;img&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;../image/one.jpeg&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;text&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token punctuation" data-v-c7788be4>{</span>
            system<span class="token operator" data-v-c7788be4>:</span> <span class="token punctuation" data-v-c7788be4>{</span>
              title<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'在接入人工前，智能助手将为您首次应答。'</span><span class="token punctuation" data-v-c7788be4>,</span>
              subtitle<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'猜您想问:'</span><span class="token punctuation" data-v-c7788be4>,</span>
              content<span class="token operator" data-v-c7788be4>:</span> <span class="token punctuation" data-v-c7788be4>[</span>
                <span class="token punctuation" data-v-c7788be4>{</span>
                  id<span class="token operator" data-v-c7788be4>:</span> <span class="token template-string" data-v-c7788be4><span class="token template-punctuation string" data-v-c7788be4>`</span><span class="token string" data-v-c7788be4>system1</span><span class="token template-punctuation string" data-v-c7788be4>`</span></span><span class="token punctuation" data-v-c7788be4>,</span>
                  text<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'组件如何使用'</span>
                <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
                <span class="token punctuation" data-v-c7788be4>{</span>
                  id<span class="token operator" data-v-c7788be4>:</span> <span class="token template-string" data-v-c7788be4><span class="token template-punctuation string" data-v-c7788be4>`</span><span class="token string" data-v-c7788be4>system2</span><span class="token template-punctuation string" data-v-c7788be4>`</span></span><span class="token punctuation" data-v-c7788be4>,</span>
                  text<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'组件参数在哪里查看'</span>
                <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
                <span class="token punctuation" data-v-c7788be4>{</span>
                  id<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'system'</span><span class="token punctuation" data-v-c7788be4>,</span>
                  text<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'我可不可把组件用在商业'</span>
                <span class="token punctuation" data-v-c7788be4>}</span>
              <span class="token punctuation" data-v-c7788be4>]</span>
            <span class="token punctuation" data-v-c7788be4>}</span>
          <span class="token punctuation" data-v-c7788be4>}</span>
        <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
        <span class="token punctuation" data-v-c7788be4>{</span>
          <span class="token string" data-v-c7788be4>&quot;date&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;2020/04/25 21:19:07&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;text&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token punctuation" data-v-c7788be4>{</span>
            <span class="token string" data-v-c7788be4>&quot;text&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;&lt;i class='el-icon-document-checked' style='font-size:2rem;'/&gt;&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
            <span class="token string" data-v-c7788be4>&quot;subLink&quot;</span><span class="token operator" data-v-c7788be4>:</span><span class="token punctuation" data-v-c7788be4>{</span>
              <span class="token string" data-v-c7788be4>&quot;text&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;a.txt&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
              <span class="token string" data-v-c7788be4>&quot;prop&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token punctuation" data-v-c7788be4>{</span>
                underline<span class="token operator" data-v-c7788be4>:</span> <span class="token boolean" data-v-c7788be4>false</span>
              <span class="token punctuation" data-v-c7788be4>}</span>
            <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;mine&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token boolean" data-v-c7788be4>false</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;name&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;留恋人间不羡仙&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;img&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;../image/one.jpeg&quot;</span>
        <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
      <span class="token punctuation" data-v-c7788be4>]</span>
    <span class="token keyword" data-v-c7788be4>this</span><span class="token punctuation" data-v-c7788be4>.</span>taleList <span class="token operator" data-v-c7788be4>=</span> list
  <span class="token punctuation" data-v-c7788be4>}</span>
<span class="token punctuation" data-v-c7788be4>}</span>
</span></span><span class="token tag" data-v-c7788be4><span class="token tag" data-v-c7788be4><span class="token punctuation" data-v-c7788be4>&lt;/</span>script</span><span class="token punctuation" data-v-c7788be4>&gt;</span></span>

</code></pre></div></details> <h2 id="参数配置" data-v-c7788be4><a href="#参数配置" class="header-anchor" data-v-c7788be4>#</a> 参数配置</h2> <h3 id="attribute" data-v-c7788be4><a href="#attribute" class="header-anchor" data-v-c7788be4>#</a> Attribute</h3> <table data-v-c7788be4><thead data-v-c7788be4><tr data-v-c7788be4><th style="text-align:center;" data-v-c7788be4>参数</th> <th style="text-align:center;" data-v-c7788be4>说明</th> <th style="text-align:center;" data-v-c7788be4>类型</th> <th style="text-align:center;" data-v-c7788be4>可选值</th> <th style="text-align:center;" data-v-c7788be4>默认值</th></tr></thead> <tbody data-v-c7788be4><tr data-v-c7788be4><td style="text-align:center;" data-v-c7788be4>v-model</td> <td style="text-align:center;" data-v-c7788be4>输入框中的文字</td> <td style="text-align:center;" data-v-c7788be4>String</td> <td style="text-align:center;" data-v-c7788be4>-</td> <td style="text-align:center;" data-v-c7788be4>&quot;&quot;</td></tr> <tr data-v-c7788be4><td style="text-align:center;" data-v-c7788be4>taleList</td> <td style="text-align:center;" data-v-c7788be4>要渲染的数据</td> <td style="text-align:center;" data-v-c7788be4>Array</td> <td style="text-align:center;" data-v-c7788be4>-</td> <td style="text-align:center;" data-v-c7788be4>[]</td></tr> <tr data-v-c7788be4><td style="text-align:center;" data-v-c7788be4>toolConfig</td> <td style="text-align:center;" data-v-c7788be4>工具栏配置</td> <td style="text-align:center;" data-v-c7788be4>Object</td> <td style="text-align:center;" data-v-c7788be4>-</td> <td style="text-align:center;" data-v-c7788be4>{}</td></tr> <tr data-v-c7788be4><td style="text-align:center;" data-v-c7788be4>width</td> <td style="text-align:center;" data-v-c7788be4>聊天框宽度</td> <td style="text-align:center;" data-v-c7788be4>string</td> <td style="text-align:center;" data-v-c7788be4>-</td> <td style="text-align:center;" data-v-c7788be4>550px</td></tr> <tr data-v-c7788be4><td style="text-align:center;" data-v-c7788be4>height</td> <td style="text-align:center;" data-v-c7788be4>聊天框高度</td> <td style="text-align:center;" data-v-c7788be4>string</td> <td style="text-align:center;" data-v-c7788be4>-</td> <td style="text-align:center;" data-v-c7788be4>500px</td></tr> <tr data-v-c7788be4><td style="text-align:center;" data-v-c7788be4>config</td> <td style="text-align:center;" data-v-c7788be4>组件配置项</td> <td style="text-align:center;" data-v-c7788be4>Object</td> <td style="text-align:center;" data-v-c7788be4>-</td> <td style="text-align:center;" data-v-c7788be4>{}</td></tr> <tr data-v-c7788be4><td style="text-align:center;" data-v-c7788be4>scrollType</td> <td style="text-align:center;" data-v-c7788be4>滚动类型</td> <td style="text-align:center;" data-v-c7788be4>String</td> <td style="text-align:center;" data-v-c7788be4>scroll (滚动到最新消息)</td> <td style="text-align:center;" data-v-c7788be4>noroll (停留当期位置)</td></tr> <tr data-v-c7788be4><td style="text-align:center;" data-v-c7788be4>quickList</td> <td style="text-align:center;" data-v-c7788be4>快捷回复-根据输入内容显示</td> <td style="text-align:center;" data-v-c7788be4>Array</td> <td style="text-align:center;" data-v-c7788be4>-</td> <td style="text-align:center;" data-v-c7788be4>[]</td></tr> <tr data-v-c7788be4><td style="text-align:center;" data-v-c7788be4>placeholder</td> <td style="text-align:center;" data-v-c7788be4>输入框占位符</td> <td style="text-align:center;" data-v-c7788be4>string</td> <td style="text-align:center;" data-v-c7788be4>-</td> <td style="text-align:center;" data-v-c7788be4>'请输入内容...'</td></tr></tbody></table> <h3 id="methods" data-v-c7788be4><a href="#methods" class="header-anchor" data-v-c7788be4>#</a> Methods</h3> <table data-v-c7788be4><thead data-v-c7788be4><tr data-v-c7788be4><th data-v-c7788be4>参数</th> <th data-v-c7788be4>说明</th> <th data-v-c7788be4>参数</th></tr></thead> <tbody data-v-c7788be4><tr data-v-c7788be4><td data-v-c7788be4>enter</td> <td data-v-c7788be4>输入框点击就发送或者回车触发的事件</td> <td data-v-c7788be4>输入的原始数据</td></tr> <tr data-v-c7788be4><td data-v-c7788be4>clickTalk</td> <td data-v-c7788be4>点击聊天框列中的用户和昵称触发事件</td> <td data-v-c7788be4>当前对话数据</td></tr></tbody></table> <h3 id="event" data-v-c7788be4><a href="#event" class="header-anchor" data-v-c7788be4>#</a> Event</h3> <table data-v-c7788be4><thead data-v-c7788be4><tr data-v-c7788be4><th data-v-c7788be4>事件</th> <th data-v-c7788be4>说明</th> <th data-v-c7788be4>传参</th></tr></thead> <tbody data-v-c7788be4><tr data-v-c7788be4><td data-v-c7788be4>finishPullDown</td> <td data-v-c7788be4>通知组件关闭加载动画</td> <td data-v-c7788be4>-</td></tr></tbody></table> <h3 id="slot" data-v-c7788be4><a href="#slot" class="header-anchor" data-v-c7788be4>#</a> Slot</h3> <table data-v-c7788be4><thead data-v-c7788be4><tr data-v-c7788be4><th data-v-c7788be4>name</th> <th data-v-c7788be4>说明</th></tr></thead> <tbody data-v-c7788be4><tr data-v-c7788be4><td data-v-c7788be4>tools</td> <td data-v-c7788be4>工具栏自定义插槽</td></tr> <tr data-v-c7788be4><td data-v-c7788be4>enter</td> <td data-v-c7788be4>舍弃组件输入框，用户自定义插槽</td></tr> <tr data-v-c7788be4><td data-v-c7788be4>downBtn</td> <td data-v-c7788be4>下拉按钮自定义插槽</td></tr> <tr data-v-c7788be4><td data-v-c7788be4>enterBtn</td> <td data-v-c7788be4>发送按钮自定义插槽</td></tr> <tr data-v-c7788be4><td data-v-c7788be4>talkItem</td> <td data-v-c7788be4>对话框自定义插槽</td></tr></tbody></table> <h3 id="toolconfig-说明" data-v-c7788be4><a href="#toolconfig-说明" class="header-anchor" data-v-c7788be4>#</a> <code data-v-c7788be4>toolConfig</code> 说明</h3> <div class="language-js extra-class" data-v-c7788be4><pre class="language-js" data-v-c7788be4><code data-v-c7788be4><span class="token punctuation" data-v-c7788be4>{</span>
    <span class="token comment" data-v-c7788be4>// 现在只配置了 [&quot;file&quot;, &quot;video&quot;, &quot;img&quot;, &quot;hongbao&quot;, &quot;more&quot;, &quot;history&quot;]</span>
    show<span class="token operator" data-v-c7788be4>:</span> <span class="token punctuation" data-v-c7788be4>[</span><span class="token string" data-v-c7788be4>'file'</span><span class="token punctuation" data-v-c7788be4>,</span> <span class="token string" data-v-c7788be4>'history'</span><span class="token punctuation" data-v-c7788be4>,</span> <span class="token string" data-v-c7788be4>'img'</span><span class="token punctuation" data-v-c7788be4>,</span> <span class="token punctuation" data-v-c7788be4>[</span><span class="token string" data-v-c7788be4>'文件1'</span><span class="token punctuation" data-v-c7788be4>,</span> <span class="token string" data-v-c7788be4>''</span><span class="token punctuation" data-v-c7788be4>,</span> <span class="token string" data-v-c7788be4>'美图'</span><span class="token punctuation" data-v-c7788be4>]</span><span class="token punctuation" data-v-c7788be4>]</span><span class="token punctuation" data-v-c7788be4>,</span><span class="token comment" data-v-c7788be4>// 二级数组中放自定义名称</span>
    showEmoji<span class="token operator" data-v-c7788be4>:</span> <span class="token boolean" data-v-c7788be4>true</span><span class="token punctuation" data-v-c7788be4>,</span> <span class="token comment" data-v-c7788be4>// 是否显示表情图标</span>
     <span class="token comment" data-v-c7788be4>/**
     * @description: 点击按钮的回调函数
     * @param {*} type 当前点击的按钮
     * @param {*} plyload 附加文件或者需要处理的数据
     * @return {*}
     */</span>
	callback<span class="token operator" data-v-c7788be4>:</span> <span class="token function" data-v-c7788be4>toolEvent</span> <span class="token punctuation" data-v-c7788be4>(</span><span class="token parameter" data-v-c7788be4>type<span class="token punctuation" data-v-c7788be4>,</span> plyload</span><span class="token punctuation" data-v-c7788be4>)</span> <span class="token punctuation" data-v-c7788be4>{</span>
   		console<span class="token punctuation" data-v-c7788be4>.</span><span class="token function" data-v-c7788be4>log</span><span class="token punctuation" data-v-c7788be4>(</span><span class="token string" data-v-c7788be4>'tools'</span><span class="token punctuation" data-v-c7788be4>,</span> type<span class="token punctuation" data-v-c7788be4>,</span> plyload<span class="token punctuation" data-v-c7788be4>)</span>
	<span class="token punctuation" data-v-c7788be4>}</span>    
<span class="token punctuation" data-v-c7788be4>}</span>
    

</code></pre></div><h3 id="config-说明" data-v-c7788be4><a href="#config-说明" class="header-anchor" data-v-c7788be4>#</a> <code data-v-c7788be4>config</code> 说明</h3> <div class="language-js extra-class" data-v-c7788be4><pre class="language-js" data-v-c7788be4><code data-v-c7788be4><span class="token punctuation" data-v-c7788be4>{</span>
  historyConfig<span class="token operator" data-v-c7788be4>:</span> <span class="token punctuation" data-v-c7788be4>{</span>
    show<span class="token operator" data-v-c7788be4>:</span> <span class="token boolean" data-v-c7788be4>true</span><span class="token punctuation" data-v-c7788be4>,</span>
    tip<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'滚动到顶时候显示的提示'</span><span class="token punctuation" data-v-c7788be4>,</span>
    <span class="token comment" data-v-c7788be4>/**
     * @description: 点击加载更多的回调函数
     * @param {*}
     * @return {*}
     */</span>
    callback<span class="token operator" data-v-c7788be4>:</span> <span class="token function" data-v-c7788be4>bindLoadHistory</span> <span class="token punctuation" data-v-c7788be4>(</span><span class="token parameter" data-v-c7788be4>done</span><span class="token punctuation" data-v-c7788be4>)</span> <span class="token punctuation" data-v-c7788be4>{</span>
      <span class="token keyword" data-v-c7788be4>const</span> history <span class="token operator" data-v-c7788be4>=</span> <span class="token keyword" data-v-c7788be4>new</span> <span class="token class-name" data-v-c7788be4>Array</span><span class="token punctuation" data-v-c7788be4>(</span><span class="token number" data-v-c7788be4>3</span><span class="token punctuation" data-v-c7788be4>)</span><span class="token punctuation" data-v-c7788be4>.</span><span class="token function" data-v-c7788be4>fill</span><span class="token punctuation" data-v-c7788be4>(</span><span class="token punctuation" data-v-c7788be4>)</span><span class="token punctuation" data-v-c7788be4>.</span><span class="token function" data-v-c7788be4>map</span><span class="token punctuation" data-v-c7788be4>(</span><span class="token punctuation" data-v-c7788be4>(</span><span class="token parameter" data-v-c7788be4>i<span class="token punctuation" data-v-c7788be4>,</span> j</span><span class="token punctuation" data-v-c7788be4>)</span> <span class="token operator" data-v-c7788be4>=&gt;</span> <span class="token punctuation" data-v-c7788be4>{</span>
        <span class="token keyword" data-v-c7788be4>return</span> <span class="token punctuation" data-v-c7788be4>{</span>
          <span class="token string" data-v-c7788be4>&quot;date&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;2020/05/20 23:19:07&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;text&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token punctuation" data-v-c7788be4>{</span> <span class="token string" data-v-c7788be4>&quot;text&quot;</span><span class="token operator" data-v-c7788be4>:</span> j <span class="token operator" data-v-c7788be4>+</span> <span class="token keyword" data-v-c7788be4>new</span> <span class="token class-name" data-v-c7788be4>Date</span><span class="token punctuation" data-v-c7788be4>(</span><span class="token punctuation" data-v-c7788be4>)</span> <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;mine&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token boolean" data-v-c7788be4>false</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;name&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;JwChat&quot;</span><span class="token punctuation" data-v-c7788be4>,</span>
          <span class="token string" data-v-c7788be4>&quot;img&quot;</span><span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>&quot;image/three.jpeg&quot;</span>
        <span class="token punctuation" data-v-c7788be4>}</span>
      <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>)</span>
      <span class="token keyword" data-v-c7788be4>let</span> list <span class="token operator" data-v-c7788be4>=</span> history<span class="token punctuation" data-v-c7788be4>.</span><span class="token function" data-v-c7788be4>concat</span><span class="token punctuation" data-v-c7788be4>(</span><span class="token keyword" data-v-c7788be4>this</span><span class="token punctuation" data-v-c7788be4>.</span>list<span class="token punctuation" data-v-c7788be4>)</span>
      <span class="token keyword" data-v-c7788be4>this</span><span class="token punctuation" data-v-c7788be4>.</span>list <span class="token operator" data-v-c7788be4>=</span> list
      <span class="token comment" data-v-c7788be4>//  加载完成后通知组件关闭加载动画</span>
      <span class="token keyword" data-v-c7788be4>this</span><span class="token punctuation" data-v-c7788be4>.</span>config<span class="token punctuation" data-v-c7788be4>.</span>historyConfig<span class="token punctuation" data-v-c7788be4>.</span>tip <span class="token operator" data-v-c7788be4>=</span> <span class="token string" data-v-c7788be4>&quot;加载完成&quot;</span><span class="token punctuation" data-v-c7788be4>;</span>
      <span class="token keyword" data-v-c7788be4>this</span><span class="token punctuation" data-v-c7788be4>.</span><span class="token function" data-v-c7788be4>$nextTick</span><span class="token punctuation" data-v-c7788be4>(</span><span class="token punctuation" data-v-c7788be4>(</span><span class="token punctuation" data-v-c7788be4>)</span> <span class="token operator" data-v-c7788be4>=&gt;</span> <span class="token punctuation" data-v-c7788be4>{</span>
        <span class="token comment" data-v-c7788be4>// 组件完成加载后需要需要告知组件 下列方法任选一种</span>
        <span class="token comment" data-v-c7788be4>// 1.直接调用 done</span>
        <span class="token function" data-v-c7788be4>done</span><span class="token punctuation" data-v-c7788be4>(</span><span class="token punctuation" data-v-c7788be4>)</span>
        <span class="token comment" data-v-c7788be4>// 2.直接使用组件方法</span>
        <span class="token comment" data-v-c7788be4>// this.$refs.jwChat.finishPullDown();</span>
      <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>)</span><span class="token punctuation" data-v-c7788be4>;</span>
    <span class="token punctuation" data-v-c7788be4>}</span> 
  <span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
  maxlength<span class="token operator" data-v-c7788be4>:</span> <span class="token number" data-v-c7788be4>300</span><span class="token punctuation" data-v-c7788be4>,</span> <span class="token comment" data-v-c7788be4>// 输入框长度，默认300</span>
<span class="token punctuation" data-v-c7788be4>}</span>
</code></pre></div><h3 id="quicklist-说明" data-v-c7788be4><a href="#quicklist-说明" class="header-anchor" data-v-c7788be4>#</a> <code data-v-c7788be4>quickList</code> 说明</h3> <div class="language-js extra-class" data-v-c7788be4><pre class="language-js" data-v-c7788be4><code data-v-c7788be4><span class="token punctuation" data-v-c7788be4>[</span>
  <span class="token punctuation" data-v-c7788be4>{</span>text<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'这里是jwchat，您想了解什么问题。'</span><span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
  <span class="token punctuation" data-v-c7788be4>{</span>text<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'jwchat是最好的聊天组件'</span><span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
  <span class="token punctuation" data-v-c7788be4>{</span>text<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'谁将烟焚散，散了纵横的牵绊；听弦断，断那三千痴缠。'</span><span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
  <span class="token punctuation" data-v-c7788be4>{</span>text<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'长夏逝去。山野间的初秋悄然涉足。'</span><span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
  <span class="token punctuation" data-v-c7788be4>{</span>text<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'江南风骨，天水成碧，天教心愿与身违。'</span><span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
  <span class="token punctuation" data-v-c7788be4>{</span>text<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'总在不经意的年生。回首彼岸。纵然发现光景绵长。'</span><span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
  <span class="token punctuation" data-v-c7788be4>{</span>text<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'外面的烟花奋力的燃着，屋里的人激情的说着情话'</span><span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
  <span class="token punctuation" data-v-c7788be4>{</span>text<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'假如你是云，我就是雨，一生相伴，风风雨雨；'</span><span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
  <span class="token punctuation" data-v-c7788be4>{</span>text<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>'即使泪水在眼中打转，我依旧可以笑的很美，这是你学不来的坚强。'</span><span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
  <span class="token punctuation" data-v-c7788be4>{</span>text<span class="token operator" data-v-c7788be4>:</span> <span class="token string" data-v-c7788be4>' 因为不知来生来世会不会遇到你，所以今生今世我会加倍爱你。'</span><span class="token punctuation" data-v-c7788be4>}</span><span class="token punctuation" data-v-c7788be4>,</span>
<span class="token punctuation" data-v-c7788be4>]</span>
</code></pre></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">上次更新:</span> <span class="time">2023/9/21 11:08:42</span></div></footer> <div class="page-nav"><p class="inner"><!----> <span class="next"><a href="/jwchatdoc/component/chatIndex.html">
        chat组件界面
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"></div></div>
    <script src="/jwchatdoc/assets/js/app.2f005bd9.js" defer></script><script src="/jwchatdoc/assets/js/2.0a6120b0.js" defer></script><script src="/jwchatdoc/assets/js/4.9bd699fc.js" defer></script>
  </body>
</html>
